package cn.com.surker.task;

import cn.com.surker.system.dao.SysLogDao;
import cn.com.surker.util.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import javax.annotation.Resource;
import java.util.Date;

/**
 * @Author lucky
 * @create 2025年03月29 8:33
 * @desc
 */
@Slf4j
@Configuration
@EnableScheduling
public class SystemTask {

    @Resource
    private SysLogDao logDao;

    @Scheduled(cron = "43 3 3 * * ?")
    public void billReportTime() {
        Date nowDate = new Date();
        String nowTime = DateUtil.convertString(DateUtil.convertBeforeDayDate(nowDate, 60));
        logDao.clearSyncHistory(nowTime);
    }
}
